Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Image Compressor Component Capabilities

Apple has defined several component flags for image compressor components. These flags specify information about the capabilities of the component. You set these flags in the componentFlags field of your component's component description structure. The Image Compression Manager uses these same flags in the compressor information structure to describe the capabilities of image compressors and decompressors. For a complete description of this structure, see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime .

The compressFlags and decompressFlags fields of the compressor information structure contain a number of flags that define the capabilities of your component.

If the compressor information structure is shared, the compressor component uses the component flags that are the same as the compression flags for the component description structure, and the decompressor component uses the component flags that are the same as the decompression flags for the component description structure.

The flag bits for those fields are defined as follows (each flag is valid for both fields unless the description states otherwise):

#define codecInfoDoes1                          (1L<<0)     /* works with 1-bit pixel
                                                                maps */
#define codecInfoDoes2                          (1L<<1)     /* works with 2-bit pixel
                                                                maps */
#define codecInfoDoes4                          (1L<<2)     /* works with 4-bit pixel
                                                                maps */
#define codecInfoDoes8                          (1L<<3)     /* works with 8-bit pixel
                                                                maps */
#define codecInfoDoes16                         (1L<<4)     /* works with 16-bit pixel
                                                                maps */

#define codecInfoDoes32                         (1L<<5)     /* works with 32-bit pixel
                                                                maps */
#define codecInfoDoesDither                     (1L<<6)     /* supports fast dithering */
#define codecInfoDoesStretch                    (1L<<7)     /* stretches to arbitrary
                                                                sizes */
#define codecInfoDoesShrink                     (1L<<8)     /* shrinks to arbitrary sizes */#define codecInfoDoesMask
(1L<<9)     /* handles clipping regions */
#define codecInfoDoesTemporal                   (1L<<10)    /* sequential temporal
                                                                compression */
#define codecInfoDoesDouble                     (1L<<11)    /* stretches to double size
                                                                exactly */
#define codecInfoDoesQuad                       (1L<<12)    /* stretches to quadruple
                                                                size */
#define codecInfoDoesHalf                       (1L<<13)    /* shrinks to half size */
#define codecInfoDoesQuarter                    (1L<<14)    /* shrinks to one-quarter
                                                                size */
#define codecInfoDoesRotate                     (1L<<15)    /* rotates during
                                                                decompression */
#define codecInfoDoesHorizFlip                  (1L<<16)    /* flips horizontally during
                                                                decompression */
#define codecInfoDoesVertFlip                   (1L<<17)    /* flips vertically during
                                                                decompression */
#define codecInfoDoesSkew                       (1L<<18)    /* skews image during
                                                                 decompression */
#define codecInfoDoesBlend                      (1L<<19)    /* blends image with matte
                                                                during decompression */
#define codecInfoDoesWarp                       (1L<<20)    /* warps image arbitrarily
                                                                during decompression */
#define codecInfoDoesRecompress                 (1L<<21)    /*  recompresses images without
                                                                accumulating errors */
#define codecInfoDoesSpool                      (1L<<22)    /*  uses data-loading or    
                                                                data-unloading function */
#define codecInfoDoesRateConstrain              (1L<<23)    /* constrains amount of
                                                                generated data to
                                                                caller-defined limit */

Flag descriptions

codecInfoDoes1
Indicates whether the component can work with pixel maps that contain 1-bit pixels. If this flag is set to 1, then the component can compress or decompress images that contain 1-bit pixels. If this flag is set to 0, then the component cannot handle such images.
codecInfoDoes2
Indicates whether the component can work with pixel maps that contain 2-bit pixels. If this flag is set to 1, then the component can compress or decompress images that contain 2-bit pixels. If this flag is set to 0, then the component cannot handle such images.
codecInfoDoes4
Indicates whether the component can work with pixel maps that contain 4-bit pixels. If this flag is set to 1, then the component can compress or decompress images that contain 4-bit pixels. If this flag is set to 0, then the component cannot handle such images.
codecInfoDoes8
Indicates whether the component can work with pixel maps that contain 8-bit pixels. If this flag is set to 1, then the component can compress or decompress images that contain 8-bit pixels. If this flag is set to 0, then the component cannot handle such images.
codecInfoDoes16
Indicates whether the component can work with pixel maps that contain 16-bit pixels. If this flag is set to 1, then the component can compress or decompress images that contain 16-bit pixels. If this flag is set to 0, then the component cannot handle such images.
codecInfoDoes32
Indicates whether the component can work with pixel maps that contain 32-bit pixels. If this flag is set to 1, then the component can compress or decompress images that contain 32-bit pixels. If this flag is set to 0, then the component cannot handle such images.
codecInfoDoesDither
Indicates whether the component supports dithering. If this flag is set to 1, the component supports dithering of colors. If this flag is set to 0, the component does not support dithering. This flag is only available for decompressor components.
codecInfoDoesStretch
Indicates whether the component can stretch images to arbitrary sizes. If this flag is set to 1, the component can stretch images. If this flag is set to 0, the component does not support stretching. This flag is only available for decompressor components.
codecInfoDoesShrink
Indicates whether the component can shrink images to arbitrary sizes. If this flag is set to 1, the component can shrink images. If this flag is set to 0, the component does not support shrinking. This flag is only available for decompressor components.
codecInfoDoesMask
Indicates whether the component can handle clipping regions. If this flag is set to 1, the component can mask to an arbitrary clipping region. If this flag is set to 0, the component does not support clipping regions. This flag is only available for decompressor components.
codecInfoDoesTemporal
Indicates whether the component supports temporal compression in sequences. If this flag is set to 1, the component supports time compression. If this flag is set to 0, the component does not support time compression.
codecInfoDoesDouble
Indicates whether the component supports stretching to double size during decompression. Since images are in two dimensions (height and width), this means a total of four times as many pixels. The parameters for the stretch operation are specified in the matrix structure for the request--the component modifies the scaling attributes of the matrix (see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for information about transformation matrices). If this flag is set to 1, the component can stretch an image to exactly four times its original size, up to the maximum size supported by the decompressor. If this flag is set to 0, the component does not support stretching to double size. This flag is valid only for the decompressFlags field.
codecInfoDoesQuad
Indicates whether the component supports stretching an image to four times its original size during decompression. Since images are in two dimensions (height and width), this means a total of sixteen times as many pixels. The parameters for the stretch operation are specified in the matrix structure (defined by the MatrixRecord data type) for the request--the component modifies the scaling attributes of the matrix (see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for information about transformation matrices). If this flag is set to 1, the component can stretch an image to exactly sixteen times its original size, up to the maximum size supported by the decompressor. If this flag is set to 0, the component does not support this capability. This flag is valid only for the decompressFlags field.
codecInfoDoesHalf
Indicates whether the component supports shrinking an image to half of its original size during decompression. Since images are in two dimensions (height and width), this means a total of one-fourth the number of pixels. The parameters for the shrink operation are specified in the matrix structure for the request--the component modifies the scaling attributes of the matrix (see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for information about transformation matrices). If this flag is set to 1, the component can shrink an image to half size, down to the minimum size specified by the minimumHeight and minimumWidth fields in the compressor information structure. If this flag is set to 0, the component does not support this capability. This flag is valid only for the decompressFlags field.
codecInfoDoesQuarter
Indicates whether the component can shrink an image to one-quarter of its original size during decompression. Since images are in two dimensions (height and width), this means a total of one-sixteenth the number of pixels. The parameters for the shrink operation are specified in the matrix structure for the request--the component modifies the scaling attributes of the matrix (see the chapter "Movie Toolbox" in Inside Macintosh: QuickTime for information about transformation matrices). If this flag is set to 1, the component can shrink an image to exactly one-quarter of its original size, down to the minimum size specified by the minimumHeight and minimumWidth fields in the compressor information structure. If this flag is set to 0, the component does not support this capability. This flag is valid only for the decompressFlags field.
codecInfoDoesRotate
Indicates whether the component can rotate an image during decompression. The parameters for the rotation are specified in the matrix structure for a decompression operation. If this flag is set to 1, the component can rotate the image at decompression time. If this flag is set to 0, the component cannot rotate the resulting image. This flag is valid only for the decompressFlags field.
codecInfoDoesHorizFlip
Indicates whether the component can flip an image horizontally during decompression. The parameters for the horizontal flip are specified in the matrix structure for a decompression operation. If this flag is set to 1, the component can flip the image at decompression time. If this flag is set to 0, the component cannot flip the resulting image. This flag is valid only for the decompressFlags field.
codecInfoDoesVertFlip
Indicates whether the component can flip an image vertically during decompression. The parameters for the vertical flip are specified in the matrix structure for a decompression operation. If this flag is set to 1, the component can flip the image at decompression time. If this flag is set to 0, the component cannot flip the resulting image. This flag is valid only for the decompressFlags field.
codecInfoDoesSkew
Indicates whether the component can skew an image during decompression. Skewing an image distorts it linearly along only a single axis--for example, drawing a rectangular image into a parallelogram-shaped region. The parameters for the skew operation are specified in the matrix structure for the decompression request. If this flag is set to 1, the component can skew an image at decompression time. If this flag is set to 0, the component does not support this capability. This flag is valid only for the decompressFlags field.
codecInfoDoesBlend
Indicates whether the component can blend the resulting image with a matte during decompression. The matte is provided by the application in the decompression request. If this flag is set to 1, the component can blend during decompression. If this flag is set to 0, the component does not support this capability. This flag is valid only for the decompressFlags field.
codecInfoDoesWarp
Indicates whether the component can warp an image during decompression. Warping an image distorts it along one or more axes, perhaps in a nonlinear fashion, in effect "bending" the resulting region. The parameters for the warp operation are specified in the matrix structure for the decompression request. If this flag is set to 1, the component can warp an image at decompression time. If this flag is set to 0, the component does not support this capability. This flag is valid only for the decompressFlags field.
codecInfoDoesRecompress
Indicates whether the component can recompress images it has previously compressed without losing image quality. Many compression algorithms cause image degradation when you apply them repeatedly to the same image. If this flag is set to 1, the component uses an algorithm that does not compromise image quality after repeated compressions. If this flag is set to 0, you should not use the component for repeated compressions of the same image. This flag is only available for compressor components.
codecInfoDoesSpool
Indicates whether the component uses data-loading or data-unloading functions. Your application can define data-loading and data-unloading functions to help the component work with images that are too large to be stored in memory (see the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for more information about data-loading and data-unloading functions). If this flag is set to 1, the component uses these functions if needed for a given operation. If this flag is set to 0, the component does not use these functions under any circumstances.
codecInfoDoesRateConstrain
Indicates the compressor is able to constrain the amount of data it generates when compressing sequences of images to a limit defined by the caller. See the chapter "Image Compression Manager" in Inside Macintosh: QuickTime for details on data rate constraint functions. This flag is only available for compressor components.

© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next